import { ItemLogicBase } from "../../logicItem/ItemLogicBase";
import { GameTool } from "../../tool/GameTool";


export class LotterySuitItemLogic extends ItemLogicBase {


    private iconImg:Laya.Image;
    constructor(box: Laya.Sprite){
        super(box);
    }
    initNode(box: Laya.Box): void {
        this.iconImg = box.getChildByName("iconImg") as Laya.Image;
    }

    initUi(data: any[]) {
        this.data = data;
        let url = (this.data[0]).goods_icon_url;
        GameTool.setSkin(url, this.iconImg, true);
        // this.imgsp.skin = "comp/image.png";
        GameTool.gray(this.box, !this.getSelected());
    }

    protected setSelected(selected: boolean): void {
        GameTool.gray(this.box, !selected);
    }
   
    clear(): void {
        this.iconImg = null;
        this.box = null;
        this.data = null;
    }
}